package com.jnzc.ocr.rest.app.shop.controller.app;

import com.jnzc.ocr.common.bean.Page;
import com.jnzc.ocr.common.bean.PageResult;
import com.jnzc.ocr.common.vo.UserVo;
import com.jnzc.ocr.dependencies.rest.base.BaseController;
import com.jnzc.ocr.rest.app.shop.param.app.AppOrderPayParam;
import com.jnzc.ocr.serv.shop.api.ShopOrderApi;
import com.jnzc.ocr.serv.shop.consts.ShopRefundConsts;
import com.jnzc.ocr.serv.shop.entity.ShopOrder;
import com.jnzc.ocr.serv.shop.filter.ShopOrderFilter;
import com.jnzc.ocr.serv.shop.vo.ShopOrderPayVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhangcm
 * @version 1.0, 2017-10-06
 */
@Api(tags = {"app - 店铺订单表接口"})
@RestController
@RequestMapping("/app/shopOrder")
public class AppOrderController extends BaseController {

    @Autowired
    private ShopOrderApi shopOrderApi;

    @ApiOperation(value = "支付")
    @PostMapping("/pay")
    public ShopOrder pay(@RequestBody AppOrderPayParam param){
        UserVo userVo = super.get();
        ShopOrderPayVo payVo = new ShopOrderPayVo();
        payVo.setShopId(userVo.getShopId());
        payVo.setOrderId(param.getOrderId());
        payVo.setPayType(param.getPayType());
        return shopOrderApi.pay(payVo);
    }
}
